import 'package:flutter_test/flutter_test.dart';
import 'package:jdsdk/jdsdk.dart';
import 'package:jdsdk/jdsdk_platform_interface.dart';
import 'package:jdsdk/jdsdk_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockJdsdkPlatform
    with MockPlatformInterfaceMixin
    implements JdsdkPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final JdsdkPlatform initialPlatform = JdsdkPlatform.instance;

  test('$MethodChannelJdsdk is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelJdsdk>());
  });

  test('getPlatformVersion', () async {
    Jdsdk jdsdkPlugin = Jdsdk();
    MockJdsdkPlatform fakePlatform = MockJdsdkPlatform();
    JdsdkPlatform.instance = fakePlatform;

    expect(await jdsdkPlugin.getPlatformVersion(), '42');
  });
}
